\section{Multiple self-suspending tasks}
\label{sec:multipleSStasks}

In this section, we propose a solution to analyse multiple self-suspending tasks interfering together. We prove below that each higher priority self-suspending task $\tau_k$ can safely be replaced by a non-self-suspending task $\tau_k' \equals \left\langle(C_k), D_k, T_k, J_k\right\rangle$ in the response time analysis. The new parameter $J_k$ is the jitter and is given by $J_k \equals \operatorname{WCRT}_k - C_k$. The worst-case execution time $C_k$ of the equivalent task $\tau_k'$ is defined as the sum of the worst-case execution times of all $\tau_k$'s execution regions, that is, $C_k \equals \sum_{j=1}^{m_k} C_{k,j}$. 
\begin{theorem}
The interference caused by $\tau_k \in \hp{i}$ on a self-suspending task $\tau_i$ is upper-bounded by the interference caused by the transformed task $\tau_k' \equals \left\langle(C_k), D_k, T_k, J_k\right\rangle$. 
\end{theorem}
\begin{proof-sketch}
The proof is by contradiction. Let us assume that $\tau_k$ causes more interference than $\tau'_k$. There might be only two reasons for this to be true: 
(i) some jobs released by $\tau_k$ cause more interference than the jobs released by $\tau'_k$, or (ii) $\tau_k$ releases more jobs than $\tau'_k$ in a given time window.

Since $\tau_k$ is self-suspending, the interference caused by each job of $\tau_k$ is the sum of the interference caused by each of its execution regions. Therefore, the interference caused by each job of $\tau_k$ is upper-bounded by $C_k \equals \sum_{j=1}^{m_k} C_{k,j}$. Because jobs of $\tau_k'$ have a WCET of $C_k$, this contradicts (i).

Since the minimum inter-arrival times of $\tau_k$ and $\tau_k'$ are identical only their jitters may cause (ii) to be true. Now, let us compute the maximum jitter that can be experienced by the jobs of $\tau_k$. Let $a_{k,1}$ denote the arrival time of a job of $\tau_k$. Since $\operatorname{WCRT}_k$ assumes that $\tau_k$ executes for its WCET, it means that a job of $\tau_k$ cannot start executing later than $\operatorname{WCRT}_k - C_k$ after $a_{k,1}$ (otherwise it would complete after $a_{k,1} + \operatorname{WCRT}_k$ and $\operatorname{WCRT}_k$ would not be a worst-case response time). The release jitter of $\tau_k$ is therefore upper-bounded by $J_k \equals \operatorname{WCRT}_k - C_k$. This contradicts (ii) and hence proves the lemma.
\end{proof-sketch}


This new model can easily be integrated in the MILP formulation presented in the previous section. %A new set of real variables denoted as $J_{k,j}$ are introduced. 
Let $J_{k,j}$ represents the jitter experienced by the jobs of $\tau_k$ released in the $j^\text{th}$ execution region of $\sstask$. In the traditional response time analysis, the jitter can be accounted by subtracting it from the offset of the interfering task~\cite{LiuBook2000}. That is, Constraint~\eqref{opt:ceil} would become $$\NI{k,j} \leq \left\lceil \frac{R_{ss,j} - (O_{k,j} - J_{k,j})}{T_k} \right\rceil$$
However, instead of introducing a new set of variables in the optimization problem and hence increase its complexity, one can simply replace $O_{k,j}$ by $O_{k,j}'$ in Constraints~\eqref{opt:ceil} and \eqref{opt:busyperiod}, where $O_{k,j}'$ is defined as $O_{k,j}' \equals O_{k,j} - J_{k,j}$. Because $J_{k,j}$ is upper-bounded by $J_k$, this variable replacement has for consequence that the bound imposed on the offsets of the tasks in $\hp{ss}$ must be modified. Therefore, Constraints~\eqref{opt:Ok1} and~\eqref{opt:offset} must be replaced by:
\begin{align*}
&\forall \tau_k \in \hp{ss}, \forall \ssregion{j} \in \sstask:\\
& \qquad O_{k,j}' \geq -J_k \\
& \qquad O_{k,j+1}' \geq O_{k,j}' + \NI{k,j} \times T_k - ( R_{ss,j} + S_{ss,j} ) - J_k
\end{align*}

Note that those modifications to the MILP formulation do not impact its complexity and therefore the time required to find a solution to the response time analysis of $\sstask$ in comparison to the case where all interfering tasks are non-self-suspending.